package com.example.clock.basicClass;

import android.content.ContentValues;

import java.io.Serializable;

public class Task implements Serializable {
    private String taskId;//唯一标识
    private String taskName;//名字
    private String tips;//备注
    private String date;//执行日期xxxx-xx-xx
    private String startTime;//开始时间00:00:00
    private String endTime;//结束时间00:00:00
    private int lastTime;//实际持续时间（分钟）
    private int planTime;//计划持续时间（分钟）
    private String largeTags;//大标签
    private String smallTags;//小标签
    private String planId;//所绑定的计划planId,若未绑定则为0
    private int clockedTask;//本次事件是否是锁屏，1代表是，0代表不是
    private int clockedMode;//1，2，3分别代表简单，困难，地狱模式
    private int unlocked;//本次锁屏是否中途解锁结束，0是没有，1是中途解锁了，2是强制解锁


    public Task(String taskId, String taskName, String tips, String date, String startTime, String endTime, int lastTime, int planTime, String largeTags, String smallTags, String planId, int clockedTask, int clockedMode, int unlocked) {
        this.taskId = taskId;
        this.taskName = taskName;
        this.tips = tips;
        this.date = date;
        this.startTime = startTime;
        this.endTime = endTime;
        this.lastTime = lastTime;
        this.planTime = planTime;
        this.largeTags = largeTags;
        this.smallTags = smallTags;
        this.planId = planId;
        this.clockedTask = clockedTask;
        this.clockedMode = clockedMode;
        this.unlocked = unlocked;
    }

    public Task() {
        this.taskId = "-1";
        this.taskName = "name";
        this.tips = ",备注";
        this.date = "23-1-1";
        this.startTime = "11:45:14";
        this.endTime = "12:00:00";
        this.lastTime = 0;
        this.planTime = 0;
        this.largeTags = "运动";
        this.smallTags = "跑步";
        this.planId = "-1";
        this.clockedTask = 0;
        this.clockedMode = 1;
        this.unlocked = 0;
    }

    public Task(String taskId, String taskName) {
        this.taskId = taskId;
        this.taskName = taskName;
        this.tips = "TIPSSTIPS,备注";
        this.date = "23-1-1";
        this.startTime = "11:45:14";
        this.endTime = "12:00:00";
        this.lastTime = 0;
        this.planTime = 0;
        this.largeTags = "运动";
        this.smallTags = "跑步";
        this.planId = "uuu";
        this.clockedTask = 0;
        this.clockedMode = 0;
        this.unlocked = 0;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public int getLastTime() {
        return lastTime;
    }

    public void setLastTime(int lastTime) {
        this.lastTime = lastTime;
    }

    public int getPlanTime() {
        return planTime;
    }

    public void setPlanTime(int planTime) {
        this.planTime = planTime;
    }

    public String getLargeTags() {
        return largeTags;
    }

    public void setLargeTags(String largeTags) {
        this.largeTags = largeTags;
    }

    public String getSmallTags() {
        return smallTags;
    }

    public void setSmallTags(String smallTags) {
        this.smallTags = smallTags;
    }

    public String getPlanId() {
        return planId;
    }

    public void setPlanId(String planId) {
        this.planId = planId;
    }

    public int isClockedTask() {
        return clockedTask;
    }

    public void setClockedTask(int clockedTask) {
        this.clockedTask = clockedTask;
    }

    public int getClockedMode() {
        return clockedMode;
    }

    public void setClockedMode(int clockedMode) {
        this.clockedMode = clockedMode;
    }

    public int getUnlocked() {
        return unlocked;
    }

    public void setUnlocked(int unlocked) {
        this.unlocked = unlocked;
    }
    public ContentValues toCV(){
        Task task = this;
        ContentValues cv = new ContentValues();
        cv.put("taskId",task.taskId);
        cv.put("taskName",task.taskName);
        cv.put("tips",task.tips);
        cv.put("date",task.date);
        cv.put("startTime",task.startTime);
        cv.put("endTime",task.endTime);
        cv.put("lastTime",task.lastTime);
        cv.put("planTime",task.planTime);
        cv.put("largeTags",task.largeTags);
        cv.put("SmallTags",task.smallTags);
        cv.put("planId",task.planId);
        cv.put("clockedTask",task.clockedTask);
        cv.put("clockedMode",task.clockedMode);
        cv.put("unlocked",task.unlocked);
        return cv;
    }
    @Override
    public String toString() {
        return "Task{" +
                "taskId='" + taskId + '\'' +
                ", taskName='" + taskName + '\'' +
                ", tips='" + tips + '\'' +
                ", date='" + date + '\'' +
                ", startTime='" + startTime + '\'' +
                ", endTime='" + endTime + '\'' +
                ", lastTime=" + lastTime +
                ", planTime=" + planTime +
                ", largeTags='" + largeTags + '\'' +
                ", smallTags='" + smallTags + '\'' +
                ", planId='" + planId + '\'' +
                ", clockedTask=" + clockedTask +
                ", clockedMode=" + clockedMode +
                ", unlocked=" + unlocked +
                '}';
    }
}
